const express = require("express");
// 文章
const banner = require("../middleware/banner");
// 创建应用
const bannerApp = express();
bannerApp.get('/getBanner', [banner.getBanner], (req, res) => {
    console.log(req.bannerList, '==============');
    res.send(req.bannerList);
});
bannerApp.post('/updateBanner', [banner.updateBanner], (req, res) => {
    if (req.data.affectedRows) {
        res.json({
            code: 200,
            msg: req.data.msg + '成功'
        });
    } else {
        res.json({
            code: 404,
            msg: req.data.msg + "失败",
        });
    }
})
module.exports = bannerApp;
